const express = require('express'); //引入express模块
const db = require('../db'); //引入db



const router = express.Router();
module.exports = router;

//编写接口
router.get('/list',async (req,res)=>{
    //查询数据库，并把查询结果响应到前端
    const sql = `select * from user`

   const data = await db(sql);
   res.send(data);
});

// //路由中间件
// const router = express.Router();
// module.exports = router;